import { StringWithAutocomplete } from "components/utils/common";

const docsHashes: Record<string, StringWithAutocomplete<"MISSING_DOCS">> = {
    "databases/documents": "H6XJDZ",
    "databases/documents/revisions/bin": "T4Y76K",
    "databases/patch(/:recentPatchHash)": "VXSYQ7",
    "databases/query/index(/:indexNameOrRecentQueryIndex)": "83ETX5",
    "databases/edit": "XZZG2L",
    "databases/ts/edit": "LAOONW",
    "databases/identities": "KOVX2N",
    "databases/cmpXchg": "4ECP1H",
    "databases/cmpXchg/edit": "4ECP1H",
    "databases/documents/conflicts": "MJQ7KX",
    "databases/indexes": "7HOOEA",
    "databases/indexes/performance": "Y15KAM",
    "databases/indexes/visualizer": "E2NPXE",
    "databases/indexes/new": "XZXJP2",
    "databases/indexes/edit(/:indexName)": "XZXJP2",
    "databases/tasks/backups": "GMBYOH",
    "databases/tasks/editPeriodicBackupTask": "GMBYOH",
    "databases/tasks/ongoingTasks": "K4ZTNA",
    "databases/tasks/import/file": "ARNHZL",
    "databases/tasks/import/migrateRavenDB": "DHA131",
    "databases/tasks/import/csv": "DRE9LN",
    "databases/tasks/import/sql": "YXQXYH",
    "databases/tasks/migrate": "GCC1JO",
    "databases/tasks/exportDatabase": "NH3ZK7",
    "databases/tasks/sampleData": "SUTS29",
    "databases/tasks/editExternalReplicationTask": "MZOBO3",
    "databases/tasks/editReplicationHubTask": "NIH5LN",
    "databases/tasks/editReplicationSinkTask": "MMUKGD",
    "databases/tasks/editSubscriptionTask": "I5TMCK",
    "databases/tasks/editRavenEtlTask": "GFSWLI",
    "databases/tasks/editSqlEtlTask": "7J6SEO",
    "databases/tasks/editOlapEtlTask": "LYZL56",
    "databases/tasks/editElasticSearchEtlTask": "AHPBTX",
    "databases/tasks/editKafkaEtlTask": "S45O2Y",
    "databases/tasks/editRabbitMqEtlTask": "KFKQM7",
    "databases/tasks/editAzureQueueStorageEtlTask": "VV1B95",
    "databases/tasks/editAmazonSqsEtlTask": "GWG3JT",
    "databases/tasks/editKafkaSinkTask": "I4L8MF",
    "databases/tasks/editRabbitMqSinkTask": "WH5IOA",
    "databases/settings/databaseSettings": "XVA22M",
    "databases/settings/conflictResolution": "QRCNKH",
    "databases/settings/clientConfiguration": "XYJ3B3",
    "databases/settings/studioConfiguration": "HIR1VP",
    "databases/settings/revisions": "OFVLX8",
    "databases/settings/revertRevisions": "OFVLX8",
    "databases/settings/refresh": "1PKUYJ",
    "databases/settings/expiration": "XBFEKZ",
    "databases/settings/documentsCompression": "E2WX16",
    "databases/settings/dataArchival": "VJAQ4B",
    "databases/settings/timeSeries": "LNOMKT",
    "databases/settings/customSorters": "XI6BMT",
    "databases/settings/customAnalyzers": "VWCQPI",
    "databases/manageDatabaseGroup": "J4JBKC",
    "databases/settings/integrations": "ZE1BYH",
    "databases/advanced/databaseRecord": "LJNTFQ",
    "databases/status/storage/report": "XMCDA2",
    "databases/status/ongoingTasksStats": "FKQ9VI",
    databases: "OTVOAG",
    clusterDashboard: "KINEPC",
    "admin/settings/cluster": "8PH7KR",
    "admin/settings/addClusterNode": "VQ37WR",
    "admin/settings/clientConfiguration": "TS7SGF",
    "admin/settings/studioConfiguration": "HIR1VP",
    "admin/settings/adminJsConsole": "IBUJ7M",
    "admin/settings/certificates": "S3G2T1",
    "admin/settings/editServerWideBackup": "SXSM33",
    "admin/settings/editServerWideExternalReplication": "MZOBO3",
    "admin/settings/serverWideCustomAnalyzers": "VWCQPI",
    "admin/settings/serverWideCustomSorters": "XI6BMT",
    // routs for which the documentation is missing (there may be more)
    "databases/indexes/terms/(:indexName)": "MISSING_DOCS",
    "databases/indexes/cleanup": "MISSING_DOCS",
    "databases/status/buckets/report": "MISSING_DOCS",
    "databases/indexes/indexErrors": "MISSING_DOCS",
    "databases/settings/connectionStrings": "MISSING_DOCS",
    "databases/advanced/databaseIDs": "MISSING_DOCS",
    "databases/advanced/tombstonesState": "MISSING_DOCS",
    "databases/status": "MISSING_DOCS",
    "databases/status/ioStats": "MISSING_DOCS",
    "admin/settings/adminLogs": "MISSING_DOCS",
    "admin/settings/serverWideTasks": "MISSING_DOCS",
    "admin/settings/serverSettings": "MISSING_DOCS",
    "admin/settings/trafficWatch": "MISSING_DOCS",
    "admin/settings/debugInfo": "MISSING_DOCS",
    "admin/settings/storageReport": "MISSING_DOCS",
    "admin/settings/ioStats": "MISSING_DOCS",
    "admin/settings/captureStackTraces": "MISSING_DOCS",
    "admin/settings/runningQueries": "MISSING_DOCS",
    "admin/settings/debug/advanced/threadsRuntime": "MISSING_DOCS",
    "admin/settings/debug/advanced/memoryMappedFiles": "MISSING_DOCS",
    "admin/settings/debug/advanced/observerLog": "MISSING_DOCS",
    "admin/settings/debug/advanced/recordTransactionCommands": "MISSING_DOCS",
    "admin/settings/debug/advanced/replayTransactionCommands": "MISSING_DOCS",
    about: "MISSING_DOCS",
    "databases/tasks/editSnowflakeEtlTask": "MISSING_DOCS",
    "databases/documents/revisions/all": "MISSING_DOCS",
    "databases/settings/revisionsBinCleaner": "MISSING_DOCS",
};

export function getDocsHash(route: string): StringWithAutocomplete<"MISSING_DOCS"> {
    const hash = docsHashes[route];

    if (!hash) {
        return "MISSING_DOCS";
    }

    return hash;
}
